<template>
  <div class="q-pa-md q-gutter-sm">

    <t-button label="Confirm"       class="tr-button-default tr-button-responsive-lg"  @click="confirm = true" />
    <t-button  label="Prompt" color="primary" @click="prompt = true" />

    <t-dialog
    ref="child"
    v-model:show="confirm"
    :closeable='true'
    title="这是对话框标题"
    :maximized="true"
     class='fasr_drawer_ad2de3 tr-drawer'
    instanceCode='fasr_drawer_ad2de3'
    position='right'
    >
      <t-card style="width: 450px;height: 156px;padding-top: 16px;">
         <t-card-section class="q-pt-none">
         这是对话框标题
        </t-card-section>
        <t-card-section class="q-pt-none">
          Lorem ipsum dolor sit amet consectetur adipisicing elit. Rerum
          repelldawdwdawdendus sit voluptate voluptas eveniet porro. Rerum blanditiis

        </t-card-section>
      </t-card>
    </t-dialog>
      <t-dialog

    style='opacity:100%'
    class='fasr_drawer102715 tr-drawer-default'
    position='right'
    :tabIndex='0'
    :no-backdrop-dismiss='false'
    :maximized='true'
  >
    <div
      style='width:400px; height:100%;padding:16px;background:#FFFFFF'
    >
      <t-editor

        style='opacity:100%'
        class='fasr_editor102726'
        :tabIndex='0'
      >
      </t-editor>
    </div>
  </t-dialog>

    <q-dialog persistent>
      <t-card>
        <t-card-section class="row items-center">
          <t-avatar icon="signal_wifi_off" color="primary" text-color="white" />
          <span class="q-ml-sm"
            >You are currently not connected to any network.</span
          >
        </t-card-section>

        <t-card-actions align="right">
          <t-button  flat label="Cancel" color="primary" v-close-popup />
          <t-button  flat label="Turn on Wifi" color="primary" v-close-popup />
        </t-card-actions>
      </t-card>
    </q-dialog>

    <t-dialog v-model="prompt" persistent>
      <t-card style="min-width: 350px">
        <t-card-section>
          <div class="text-h6">Your address</div>
        </t-card-section>

        <t-card-section class="q-pt-none">
          <t-input
            dense
            v-model="address"
            autofocus
            @keyup.enter="prompt = false"
          />
        </t-card-section>

        <t-card-actions align="right" class="text-primary">
          <t-button  flat label="Cancel" v-close-popup />
          <t-button  flat label="Add address" v-close-popup />
        </t-card-actions>
      </t-card>
    </t-dialog>
  </div>
</template>

<script>
  import { ref } from 'vue'

  export default {
    setup() {
      const alert = ref(false);
      const show = ref(false)
        const child = ref(null)
      // function myFn() {
      //   const child =this.$refs.childRef
      //   if(child){
      //      showDialog()
      //   }
      //   // debugger
      //   console.log(show.value,'dwadawd')
      // }
      return {
            showed() {
                console.log('showed')
            },
        alert,
        showDialog(){
       child.value.showDialog()
    },
        maximized:ref(true),
        confirm: ref(false),
        prompt: ref(false),
        address: ref(''),
        show,
        child

      };
    },


  };
</script>
